package com.netrust.cmsx.core.exception;

import javax.servlet.http.HttpServletRequest;

//i waste long long minute for only those simple code . should i escape coding ?
// exception is amazing 
// when you can rewrite . god ！ please tell me is there any scheme for all Exception ！
public class ProvideException extends com.netrust.cmsx.utils.exception.ProvideException{

	private static final long serialVersionUID = -8733969638407145943L;

	public static Throwable getThrowable(HttpServletRequest request){
		Throwable ex = null;
		if (request.getAttribute("exception") != null) {
			ex = (Throwable) request.getAttribute("exception");
		} else if (request.getAttribute("javax.servlet.error.exception") != null) {
			ex = (Throwable) request.getAttribute("javax.servlet.error.exception");
		}
		return ex;
	}
}
